package com.higold.cloud.mvp.model

import com.higold.cloud.mvp.model.bean.postReport.PostReport
import com.higold.cloud.mvp.model.bean.UploadPic
import com.higold.cloud.mvp.model.bean.dailyPostList.DailyPostList
import com.higold.cloud.net.RetrofitManager
import com.higold.cloud.rx.scheduler.SchedulerUtils
import io.reactivex.Observable
import okhttp3.MultipartBody

/**
 *    author : lxz
 *    date   : 2019/9/4 15:46
 *    desc   :
 */

class ReportModel {

    /**
     * 上传图片
     */
    fun requestUploadPic(value: MultipartBody.Part): Observable<UploadPic> {

        return RetrofitManager.service.upLoadImg(value)
                .compose(SchedulerUtils.ioToMain())
    }

    /**
     * 上传汇报
     */
    fun requestReport(params: HashMap<String, String>): Observable<PostReport> {

        return RetrofitManager.service.requestReport(params)
                .compose(SchedulerUtils.ioToMain())
    }

    /**
     * 业务员汇报列表
     */
    fun requestDailyPostList(): Observable<DailyPostList> {

        return RetrofitManager.service.requestDailyPostList(1)
                .compose(SchedulerUtils.ioToMain())
    }
}